﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ViewPertanyaan.aspx.cs" Inherits="SIAKAD.ViewPertanyaan" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>SIAKAD - PERTANYAAN</title>

    <!-- normalize.css -->
    <link href="Content/normalize.css" rel="stylesheet" />

    <!-- Bootstrap -->
    <link href="Content/bootstrap.min.css" rel="stylesheet" />

    <!-- SIAKAD style -->
    <link href="Content/Css/Siakad.css" rel="stylesheet" />

    <!-- jQuery -->
    <script src="Scripts/jquery-2.1.0.min.js"></script>
    <script src="Scripts/bootstrap.min.js"></script>

    <!-- SIAKAD script -->
    <script src="Scripts/Js/Siakad.js"></script>
    <script src="Scripts/Js/ViewPertanyaan.js"></script>

    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <form id="frmViewPertanyaan" runat="server">
        <asp:ScriptManager ID="scriptManager" runat="server" />

        <!-- navbar -->
        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">SIAKAD</a>
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li><a href="ViewRekomendasi.aspx">Rekomendasi</a></li>
                        <li class="active"><a href="ViewPertanyaan.aspx">Pertanyaan</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <!-- body -->
        <div class="container">
            <div class="page-header">
                <h1>Pertanyaan</h1>
            </div>

            <asp:UpdatePanel ID="upCrudGrid" runat="server">
                <ContentTemplate>
                    <asp:GridView ID="gvPertanyaan" runat="server"
                        CellSpacing="-1" GridLines="None"
                        CssClass="table table-hover" AutoGenerateColumns="false"
                        OnRowCommand="gvPertanyaan_RowCommand" DataKeyNames="id_pertanyaan"
                        AllowPaging="true" OnPageIndexChanging="gvPertanyaan_PageIndexChanging" PageSize="10">
                        <Columns>
                            <asp:TemplateField HeaderStyle-Width="70px" HeaderText="NO"> 
                                <ItemTemplate> 
                                    <%# Container.DataItemIndex + 1 %>. 
                                </ItemTemplate> 
                                <ItemStyle HorizontalAlign="Right" /> 
                            </asp:TemplateField>
                            <asp:BoundField DataField="pertanyaan" HeaderText="PERTANYAAN" />
                            <asp:ButtonField CommandName="detailRecord" Text="<span class='glyphicon glyphicon-paperclip'></span> DETAIL" ButtonType="Link" HeaderStyle-Width="90px" />
                            <asp:ButtonField CommandName="updateRecord" Text="<span class='glyphicon glyphicon-edit'></span> EDIT" ButtonType="Link" HeaderStyle-Width="70px" />
                            <asp:ButtonField CommandName="deleteRecord" Text="<span class='glyphicon glyphicon-remove'></span> DELETE" ButtonType="Link" HeaderStyle-Width="90px" />
                        </Columns>
                        <PagerSettings FirstPageText="First" LastPageText="Last" 
                            Mode="NumericFirstLast" PageButtonCount="5" NextPageText="Next" PreviousPageText="Prev" position="Bottom" />
                        <PagerStyle HorizontalAlign = "Center" CssClass = "GridPager" />
                    </asp:GridView>
                    <div style="text-align:center; margin:20px">
                        <asp:Button ID="btAdd" runat="server" Text="Tambah Pertanyaan" CssClass="btn btn-default" OnClick="btAdd_Click" />
                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btAdd" EventName="Click" />
                </Triggers>
            </asp:UpdatePanel>
        </div>

        <div id="deleteModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title"><span class="glyphicon glyphicon-trash"></span> Hapus Pertanyaan</h4>
                    </div>
                    <asp:UpdatePanel ID="upDelete" runat="server">
                        <ContentTemplate>
                            <div class="modal-body">
                                <p>Anda yakin ingin menghapus pertanyaan ini?</p><asp:HiddenField ID="hfDeleteID" runat="server" />
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
                                <asp:Button ID="btDeletePertanyaan" runat="server" Text="Hapus" CssClass="btn btn-primary" OnClick="btDeletePertanyaan_Click" />
                            </div>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btDeletePertanyaan" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </div>
        </div>

        <div id="editModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title"><span class="glyphicon glyphicon-pencil"></span> Ubah Pertanyaan</h4>
                    </div>
                    <asp:UpdatePanel ID="upEdit" runat="server">
                        <ContentTemplate>
                            <div class="modal-body">
                                <div class="form-group">
                                    <label for="txtEditPertanyaan">Pertanyaan</label>
                                    <asp:TextBox ID="txtEditPertanyaan" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style="resize:none" Rows="3" />
                                    <asp:HiddenField ID="hfUpdateID" runat="server" />
                                </div>
                                <div class="form-group">
                                    <label for="txtEditPilihanJawaban1">Pilihan Jawaban 1</label>
                                    <asp:TextBox ID="txtEditPilihanJawaban1" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style="resize:none" Rows="2" />
                                </div>
                                <div class="form-group">
                                    <label for="txtEditPilihanJawaban2">Pilihan Jawaban 2</label>
                                    <asp:TextBox ID="txtEditPilihanJawaban2" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style="resize:none" Rows="2" />
                                </div>
                                <div class="form-group">
                                    <label for="txtEditPilihanJawaban3">Pilihan Jawaban 3</label>
                                    <asp:TextBox ID="txtEditPilihanJawaban3" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style="resize:none" Rows="2" />
                                </div>
                                <div class="form-group">
                                    <label for="txtEditPilihanJawaban4">Pilihan Jawaban 4</label>
                                    <asp:TextBox ID="txtEditPilihanJawaban4" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style="resize:none" Rows="2" />
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
                                <asp:Button ID="btEditPertanyaan" runat="server" Text="Ubah" CssClass="btn btn-primary" OnClick="btEditPertanyaan_Click" />
                            </div>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="gvPertanyaan" EventName="RowCommand" />
                            <asp:AsyncPostBackTrigger ControlID="btEditPertanyaan" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
            </div>
        </div>

        <div id="addModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title"><span class="glyphicon glyphicon-plus"></span> Tambah Pertanyaan</h4>
                    </div>
                    <asp:UpdatePanel ID="upAdd" runat="server">
                        <ContentTemplate>
                            <div class="modal-body">
                                <div class="form-group">
                                    <label for="txtAddPertanyaan">Pertanyaan</label>
                                    <asp:TextBox ID="txtAddPertanyaan" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style = "resize:none" Rows="3" />
                                </div>
                                <div class="form-group">
                                    <label for="txtAddPilihanJawaban1">Pilihan Jawaban 1</label>
                                    <asp:TextBox ID="txtAddPilihanJawaban1" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style="resize:none" Rows="2" />
                                </div>
                                <div class="form-group">
                                    <label for="txtAddPilihanJawaban2">Pilihan Jawaban 2</label>
                                    <asp:TextBox ID="txtAddPilihanJawaban2" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style="resize:none" Rows="2" />
                                </div>
                                <div class="form-group">
                                    <label for="txtAddPilihanJawaban3">Pilihan Jawaban 3</label>
                                    <asp:TextBox ID="txtAddPilihanJawaban3" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style="resize:none" Rows="2" />
                                </div>
                                <div class="form-group">
                                    <label for="txtAddPilihanJawaban4">Pilihan Jawaban 4</label>
                                    <asp:TextBox ID="txtAddPilihanJawaban4" runat="server" TextMode="MultiLine"
                                        CssClass="form-control" style="resize:none" Rows="2" />
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Batal</button>
                                <asp:Button ID="btAddPertanyaan" runat="server" Text="Tambah" CssClass="btn btn-primary" OnClick="btAddPertanyaan_Click" />
                            </div>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btAddPertanyaan" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div> 
            </div>
        </div>

        <div id="detailModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title"><span class="glyphicon glyphicon-paperclip"></span> Detail Pertanyaan</h4>
                    </div>
                    <asp:UpdatePanel ID="upDetail" runat="server">
                        <ContentTemplate>
                            <div class="modal-body">
                                <div class="form-group">
                                    <label for="txtDetailPertanyaan">Pertanyaan</label>
                                    <p class="form-control-static"><asp:Literal ID="txtDetailPertanyaan" runat="server" /></p>
                                    <asp:HiddenField ID="hfDetailID" runat="server" />
                                </div>
                                <div class="form-group">
                                    <label for="txtDetailPilihanJawaban1">Pilihan Jawaban 1</label>
                                    <p class="form-control-static"><asp:Literal ID="txtDetailPilihanJawaban1" runat="server" /></p>
                                </div>
                                <div class="form-group">
                                    <label for="txtDetailPilihanJawaban2">Pilihan Jawaban 2</label>
                                    <p class="form-control-static"><asp:Literal ID="txtDetailPilihanJawaban2" runat="server" /></p>
                                </div>
                                <div class="form-group">
                                    <label for="txtDetailPilihanJawaban3">Pilihan Jawaban 3</label>
                                    <p class="form-control-static"><asp:Literal ID="txtDetailPilihanJawaban3" runat="server" /></p>
                                </div>
                                <div class="form-group">
                                    <label for="txtDetailPilihanJawaban4">Pilihan Jawaban 4</label>
                                    <p class="form-control-static"><asp:Literal ID="txtDetailPilihanJawaban4" runat="server" /></p>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Tutup</button>
                            </div>
                        </ContentTemplate>
                        <Triggers></Triggers>
                    </asp:UpdatePanel>
                </div>
            </div>
        </div>

        <!-- footer start -->
        <div id="footer">
            <div class="container">
                <p class="text-muted">&copy; <%: DateTime.Now.Year.ToString() %> Rezki Wulan Permata Sari</p>
            </div>
        </div>

    </form>
</body>
</html>
